from scrapy import cmdline

import os

# import sys
# print(sys.path)
# sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# print(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

keywords = ['Qt','c++','c#','java','python']
nKeywords = 0
print(keywords[nKeywords])

# name = 'douban_movie_top250'
# cmd = 'scrapy crawl {0}'.format(name)
# cmdline.execute(cmd.split())

# name = r'C:\Users\Administrator\Downloads\source\www_job_com-master\www_job_com\spiders\zhaopin_spider.py'
spiderpy = os.path.dirname(os.path.abspath(__file__)) + r'\spiders\job51_ajax_spider.py'

name = spiderpy#r'C:\Users\Administrator\Downloads\source\www_job_com-master\www_job_com\spiders\job51_spider.py'
# name = r'C:\Users\Administrator\Downloads\source\www_job_com-master\www_job_com\spiders\job51_spider.py'
cmd = 'scrapy runspider {0}'.format(name)
cmdline.execute(cmd.split())